﻿<?php 
    session_start();
    include "connect.php"; 
	
	if (!isset($_SESSION["taikhoan"]))
	{
		header("Location: sv-dangnhap.php");
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sinh Viên Đánh Giá Học Phần</title>

<style type="text/css">

a	{
		color: #006600;
		text-decoration: none;
	}

a:hover { COLOR: #CC0000}

.style2 {
	font-size: 18px;
	font-weight: bold;
	color: #FFFFFF;
}
.style3 {font-size: 14px; font-weight: bold; color: #FFFFFF; }
.style4 {
	color: #000099;
	font-weight: bold;
	font-size:20px;
}
.style5 {	color: #FFFFFF;
	font-weight: bold;
	font-size: 30px;
}
.bg {	border-right-color:#0066FF;
		border-bottom-color:#0066FF;
	}

.bg1 {	border-bottom-color:#0066FF;	}
.mo	{	color:#0000FF;	}
.style6 {
	font-size: 22px;
	font-weight: bold;
	color: #000099;
}
.style7{
	font-size: 20px;
	font-weight: bold;
}
</style>
</head>

<body>
<?php
        $masv=$_SESSION['sv'];

		$sql = mysql_query("Select a.ma_sv,a.ma_lop,a.ten_sv, a.namsinh_sv, a.gioitinh_sv, c.ten_khoa,d.ten_bm, b.khoa FROM `sinh vien` a, `lop sinh vien` b, `khoa` c, `bo mon` d where a.ma_sv='$masv' and a.ma_lop=b.ma_lop and b.ma_bm=d.ma_bm and d.ma_khoa=c.ma_khoa") ;		
		while($rows = mysql_fetch_array($sql))
		{
			$mssv=$rows["0"];
			$malop=$rows["1"];
			$ten=$rows["2"];
			$namsinh=$rows["3"];
			$gioitinh=$rows["4"];
			$khoa=$rows["5"];
			$bomon=$rows["6"];
			$k=$rows["7"];
	    }
	
?>

<?php
      $ma_hp=$_REQUEST["ma"];
	  $hknk=$_REQUEST["hk"];
	  $stt=$_REQUEST["nhom"];
	  $tam=mysql_query("select ten_hp from `hoc phan` where ma_hp='$ma_hp' ");
	  $t=mysql_fetch_row($tam);
	  $tenhp=$t[0];
?>
<table width="900"  border="0" align="center" bordercolorlight="#CCCCCC" style="border:1px solid #CCCCCC">

<!-- đầu trang --> 	
	<tr> <td width="900" height="70" background="image/header.gif">
    	
        <table width="100%" height="100%" border="0"> 
          <tr>
       		
          <td width="10%" rowspan="2"><img src="image/logo.gif" width="100%" height="70" /></td>
            
            <td width="60%" rowspan="2" height="80" align="center" style="font-size:24px"><div align="center">
              <blockquote>
                <p><span class="style5">Website ĐÁNH GIÁ HỌC PHẦN</span></p>
              </blockquote>
          </div></td>
   		  	
          <td width="30%" valign="bottom"> <table>
       		  <tr><td valign="bottom">
           	  <div align="center" class="style3">
              	<a class="style3" href="trangchu.php">Hướng dẫn</a> | <a class="style3" href="sv-trangchu.php">Trang chủ</a> | <a class="style3" href="logout.php">Thoát</a></div></td></tr>
       	  	  <tr><td valign="bottom">
           	  <div align="center" class="style3">Xin chào, <?php echo $ten; ?> - <?php echo $mssv; ?></div></td></tr> 
   	  	  </table> </td>
        
        </tr> </table>
    
    </td> </tr>

	<tr> <td height="20" width="100%" bordercolor="#FFFFFF"></td> </tr>
	<tr bordercolor="#FFFFFF"> 
           		<td align="center" height="150">
                	<span class="style6" style="font-size:30px">
					PHIẾU NHẬN XÉT MÔN HỌC <br />
					Mã Học Phần: <?php echo $ma_hp; ?> <br />
					Học Phần: <?php echo $tenhp; ?><br />
					Nhóm: <?php echo $stt; ?><br />
					
					</span></td>
          	</tr>
<!--than trang -->	
	<form id="f" name="f" method="post" action="sv-themdanhgia.php">	
    <tr> <td valign="top" bordercolor="#FFFFFF">
    	
        <table width="900" align="center" cellspacing="0" border="1" bordercolor="#0066FF" cellpadding="0">
       		
      		
                            
      		<tr align="center" bordercolor="#FFFFFF" bgcolor="#CCCCCC">
            	<td  height="40" class="bg" width="400"><span class="style7">Nội Dung Đánh Giá</span></td>
       	  	  	<td  class="bg1" width="500">
				          <span class="style7">Các Mức Đánh Giá</span>
						  
						  
						  <input type="hidden" name="hk" value="<?php echo $hknk; ?>" />
						  <input type="hidden" name="stt" value="<?php echo $stt; ?>" />
						  <input type="hidden" name="ma" value="<?php echo $ma_hp; ?>" />
				</td>
       	  	</tr>

		   <?php
		            $sql=mysql_query("select * from `danh gia` where ma_sv='$masv' and stt_nhom='$stt' and ma_hp='$ma_hp' and ma_hknk='$hknk'");
					$count=mysql_num_rows($sql);
					//da danh gia roi
					if($count>0)
					{
					    $sql1=mysql_query(" select a.ma_tc,a.noidung_tc,c.`muc danh gia` from `tieu chi` a, `tieuchi hocki` b,`danh gia` c where a.ma_tc=b.ma_tc and b.ma_hknk=(select max(ma_hknk) from `hocki nienkhoa`) and c.ma_sv='$masv' and c.stt_nhom='$stt' and c.ma_hp='$ma_hp' and c.ma_hknk='$hknk' and a.ma_tc=c.ma_tc  ");
						
						while($row=mysql_fetch_row($sql1))
						{
						   $matc=$row[0];
						   $noidung=$row[1];
						   $muc=$row[2];
						   
						   ?>
						   <tr bordercolor="#FFFFFF">
						       <td class="bg" height="60" style="font-size:20px;">
							         <?php echo "&nbsp;&nbsp; $matc. $noidung"; ?> 
							   </td>
							   <td class="bg1" style="font-size:16px;">
							   <?php 
							   if($muc==1)  
							   {
								  echo" <input name='$matc' type='radio' value='1' checked='checked' /> Chưa Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp; ";
								  echo " <input name='$matc' type='radio' value='2' /> Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp; ";
								  echo " <input name='$matc' type='radio' value='3' /> Rất Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp; ";
								 echo " <input name='$matc' type='radio'value='4' /> Xuất Sắc &nbsp;&nbsp;&nbsp;&nbsp; ";
								}
								else if($muc==2)
								{
								   echo" <input name='$matc' type='radio' value='1'  /> Chưa Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp; ";
								   echo " <input name='$matc' type='radio' value='2' checked='checked' /> Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp; ";
								   echo " <input name='$matc' type='radio' value='3' /> Rất Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp; ";
								   echo " <input name='$matc' type='radio'value='4' /> Xuất Sắc &nbsp;&nbsp;&nbsp;&nbsp; ";
								}
								else if($muc==3)
								{
								   echo" <input name='$matc' type='radio' value='1'  /> Chưa Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp; ";
								   echo " <input name='$matc' type='radio' value='2' /> Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp; ";
								   echo " <input name='$matc' type='radio' value='3' checked='checked' /> Rất Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp; "; 
								   echo " <input name='$matc' type='radio'value='4' /> Xuất Sắc &nbsp;&nbsp;&nbsp;&nbsp; ";
								}
								else if($muc==4)
								{
								   echo" <input name='$matc' type='radio' value='1'  /> Chưa Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp; ";
								   echo " <input name='$matc' type='radio' value='2' /> Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp; ";
								   echo " <input name='$matc' type='radio' value='3' /> Rất Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp; ";
								   echo " <input name='$matc' type='radio'value='4' checked='checked' /> Xuất Sắc &nbsp;&nbsp;&nbsp;&nbsp; ";
								}
								
							   ?>
							   </td>
                           </tr>
						   <?php
						}//while
						
					 }//if
					 else //chưa đánh giá
					 {
					    $sql1=mysql_query("select a.ma_tc,a.noidung_tc from `tieu chi` a, `tieuchi hocki` b where a.ma_tc=b.ma_tc and b.ma_hknk=(select max(ma_hknk) from `hocki nienkhoa`) ");
						
						while($row=mysql_fetch_row($sql1))
						{
						   $matc=$row[0];
						   $noidung=$row[1];
						   ?>
						   <tr bordercolor="#FFFFFF">
						       <td class="bg" height="50" style="font-size:20px;">
							         <?php echo "&nbsp;&nbsp; $matc. $noidung"; ?> 
							   </td>
							   <td class="bg1" style="font-size:17;">
							   <input name="<?php echo $matc; ?>" type="radio" value="1"  /> Chưa Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp;
							   <input name="<?php echo $matc; ?>" type="radio" value="2" checked="checked" /> Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp;
							   <input name="<?php echo $matc; ?>" type="radio" value="3" /> Rất Hài Lòng &nbsp;&nbsp;&nbsp;&nbsp;
							   <input name="<?php echo $matc; ?>" type="radio" value="4" /> Xuất Sắc &nbsp;&nbsp;&nbsp;&nbsp;
							   </td>
                           </tr>
						   <?php
						   
						}//while
						 
					 }//else
		   ?>
		   
	      <tr bordercolor="#FFFFFF"> <td height="40" colspan="2">
				<table width="100%"> <tr >
					<td width="98%" ><label><div >
					             <table cellpadding="0" cellspacing="0" border="0"  >
								       <tr >
									         <td  style="font-size:20px; font-weight:bold;">
											     <br />
												 Anh/Chị sinh viên có thể ghi thêm những nhân xét - góp ý khác:<br /><br />
												
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												<?php 
												    $t=mysql_query("select ghi_chu from hoc where ma_sv='$masv' and stt_nhom='$stt' and ma_hknk='$hknk' and ma_hp='$ma_hp'"); 
													$t1=mysql_fetch_row($t);
													$t2=$t1[0];
												?>
												 <textarea name="yk" cols="100" rows="5"><?php echo $t2; ?></textarea>
												 
												 <br />
											 </td>
											 
									   </tr>
									   <tr>
									   			<td align="center" >
											 
											 			<input name="button" type="submit" class="style6" id="button" value="Đánh Giá"/>
											   </td>
									   </tr>
								 </table>
					                 </div></label></td>
					<td width="2%" > </td>
				</tr> </table>
                </td> 
	      </tr> 
		   
		   
		  </table>
		  </td>
		  </tr>
    
</form>
	
<!--cuoi trang -->	
	<tr> <td height="5" width="100%" bordercolor="#FFFFFF"></td> </tr>

	<tr> <td height="28" background="image/footer.gif">
    	<table width="100%"> <tr >
    	
    	</tr> </table>
    </td> </tr>
</table>
</body>
</html>
